package com.hunt.service.impl;

import com.github.pagehelper.PageHelper;
import com.hunt.dao.ComPlaintFeedBackMapper;
import com.hunt.model.dto.LoginInfo_new;
import com.hunt.model.dto.PageInfo;
import com.hunt.model.entity.feedback;
import com.hunt.service.ComPlaintFeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComPlaintFeedBackServiceImpl implements ComPlaintFeedBackService {
    @Autowired
    private ComPlaintFeedBackMapper ComPlaintFeedBackMapper;
    @Override
    public int insert(String content, String linkmethod, String datetime,String title, String userid) {
        return ComPlaintFeedBackMapper.insertfeedback(content,linkmethod,datetime,title,userid);
    }

    @Override
    public PageInfo getfeedback(Integer page, Integer rows) {
        int counts =ComPlaintFeedBackMapper.selectCounts();
        PageHelper.startPage(page, rows);
        List<feedback> feedbacks =ComPlaintFeedBackMapper.getfeedback();
        PageInfo pageInfo = new PageInfo(counts,feedbacks);
        return pageInfo;
    }


}

